<!DOCTYPE html>
<html lang="en" class="deeppurple-theme">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport"
          content="width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover, user-scalable=no">
    <meta name="description" content="">
    <title>{$Think.lang.with_title}</title>
    <!-- Material design icons CSS -->
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <!-- Roboto fonts CSS -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&amp;display=swap" rel="stylesheet">
    <!-- Bootstrap core CSS -->
    <link href="/red/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <!-- Swiper CSS -->
    <link href="/red/swiper/swiper-bundle.min.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="/red/style.css?v=V1.24" rel="stylesheet">
    <link rel="stylesheet" href="/static_new/css/public.css?v=V1.24">
    <link href="/public/js/layer_mobile/need/layer.css?2.0" type="text/css" rel="styleSheet" id="layermcss">
    <style>
        .switch-type {
            padding-top: 5px;
            padding-bottom: 5px;
        }
    </style>
</head>
<body>
<a href="javascript:void(0)" class="closesidemenu">
    <i class="material-icons icons-raised bg-dark ">close</i></a>
<div class="wrapper homepage">
    <!-- header -->
    <div class="header bg-template" style="backdrop-filter:none">
        <div class="row no-gutters">
            <div class="col-auto">
                <a href="javascript:history.go(-1)" class="btn btn-link text-white">
                    <i class="material-icons">chevron_left</i></a>
            </div>
            <div class="col text-center">
                <button class="btn w-100 text-white">{$Think.lang.with_title}</button>
            </div>
            <div class="col-auto">
                <a href="{$user_service_chats}" class="btn  btn-link text-white position-relative">
                    <i class="material-icons">support_agent</i></a>
            </div>
        </div>
    </div>
    <!-- header ends -->
    <div class="container">
        <div class="card bg-template shadow mt-4" style="height: 135px">
            <div class="card-body">
                <div class="row">
                    <div class="col text-center">
                        <h3 class="mb-0 font-weight-normal">{:config('currency')} {$user.balance}</h3>
                        <p class="text-mute">{$Think.lang.with_ok_money}</p></div>
                    <!-- <div class="col-auto"><button class="btn btn-default btn-rounded-54 shadow" onclick="window.location.href=`/index/ctrl/recharge`"><i class="material-icons">add</i></button></div>-->
                </div>
            </div>
        </div>
    </div>
    <form id="main-form">
        <div class="container top-50">
            <div class="card shadow">
                <div class="card-body bg-none">
                    <div class="row">
                        <dt class="col-5 text-secondary small">{$Think.lang.with_kname}</dt>
                        <dd class="col-7 small">{$info.username|default=''}</dd>
                        <dt class="col-5 text-secondary small">{$Think.lang.with_phone}</dt>
                        <dd class="col-7 small">{$user.tel}</dd>
                        {if config('payout_wallet')}
                        <dt class="col-12 text-secondary small">
                            <div class="custom-control custom-radio switch-type">
                                <input type="radio" name="type" class="custom-control-input" id="customradio3" value="wallet" checked="">
                                <label class="custom-control-label" for="customradio3">
                                    {$Think.lang.with_new_desc}
                                </label>
                            </div>
                        </dt>
                        {/if}
                        {if config('payout_bank')}
                        <dt class="col-12 text-secondary small switch-type">
                            <div class="custom-control custom-radio">
                                <input type="radio" name="type" class="custom-control-input" id="customradio4"
                                       value="bank">
                                <label class="custom-control-label" for="customradio4">
                                    {$Think.lang.with_new_bank}
                                </label>
                            </div>
                        </dt>
                        {/if}
                        {if config('payout_usdt')}
                        <dt class="col-12 text-secondary small switch-type">
                            <div class="custom-control custom-radio">
                                <input type="radio" name="type" class="custom-control-input" id="customradio5"
                                       value="USDT">
                                <label class="custom-control-label" for="customradio5">
                                    {$Think.lang.with_new_usdt}{if $usdt_pay_info}({$Think.lang.team_rate} 1:{$usdt_pay_info.secret}){/if}
                                </label>
                            </div>
                        </dt>
                        {/if}
                    </div>
                </div>
                <div id="usdt_code_div" class="form-group" style="padding: 0 10px;display: none">
                    <input type="tel" class="form-control form-control-lg" name="USDT_code" id="USDT_code"  autocomplete="off" placeholder="USDT code">
                </div>
            </div>
        </div>
        <div class="container">
            <h6 class="subtitle">{$Think.lang.with_money}</h6>
            <div class="form-group">
                <input type="tel"  autocomplete="off" class="form-control form-control-lg" name="num" id="num"
                       placeholder="{$Think.lang.with_q_money}"></div>
            <div class="form-group">
                <input type="password" autocomplete="new-password" class="form-control form-control-lg" name="paypassword"
                       placeholder="{$Think.lang.with_q_zjmm}">
            </div>
            <button type="button" class="btn btn-lg btn-default btn-block btn-rounded shadow mt-4 submit-btn save-btn">
                {$Think.lang.with_post}
            </button>
            <div class="text-mute small mt-3">
                {$desc_info|raw}
            </div>
            <input type="hidden" id="_csrf_" name="_csrf_" value="60436ac94ba92">
            <input type="hidden" id="whats_verify" name="whats_verify" value="0"></div>
    </form>
    <div class="notification shadow pt-0 pl-0 pr-0 border-0 bg-template-light">
        <div id="notification_countdown"></div>
        <div class="row pt-2 pl-3 pr-3">
            <div class="col-auto align-self-center pr-0">
                <i class="material-icons text-template md-36">redeem</i></div>
            <div class="col small notification-content">loading...</div>
            <div class="col-auto align-self-center pl-0">
                <button class="btn btn-link closenotification">
                    <i class="material-icons text-template md-18 ">close</i></button>
            </div>
        </div>
    </div>
</div>
<div id="modal-overlay" class="modal-overlay"></div>
<div id="modal" class="modal">
    <div class="modal-inner">
        <div class="dasd-title">{$Think.lang.lxb_qrzr}</div>
        <div class="btn-box">
            <div class="confirm-btn">{$Think.lang.queding}</div>
            <div class="cancel-btn">{$Think.lang.quxiao}</div>
        </div>
    </div>
</div>
<script type="text/javascript">var app = {
    'online_popup': "",
}</script>
<!-- jquery, popper and bootstrap js -->
<script src="/red/jquery-3.3.1.min.js"></script>
<script src="/red/popper.min.js"></script>
<script src="/red/bootstrap/js/bootstrap.min.js"></script>
<!-- swiper js -->
<script src="/red/swiper/swiper-bundle.min.js"></script>
<!-- cookie js -->
<script src="/red/jquery.cookie.js"></script>
<script src="/public/js/layer_mobile/layer.js"></script>
<script charset="utf-8" src="/static_new/js/jquery.progressBarTimer.js"></script>
<script charset="utf-8" src="/static_new/js/common.js"></script>
<!-- template custom js -->
<script src="/red/main.js?v=V1.24"></script>
<script charset="utf-8" src="/static_new/js/dialog.min.js"></script>
<script type="application/javascript">
    $(function () {
        $('input[name="type"]').on('change', function () {
            if ($(this).val() == 'USDT') {
                $('#usdt_code_div').show();
            } else $('#usdt_code_div').hide();
        })
        $("input[name=num]").focus();

        function check() {
            if ($("input[name=num]").val() == '') {
                $(document).dialog({infoText: '{$Think.lang.with_q_money}'});
                return false;
            }
            if ($("input[name=paypassword]").val() == '') {
                $(document).dialog({infoText: '{$Think.lang.with_q_pass}'});
                return false;
            }
            return true;
        }

        /*点击提交*/
        var sx = parseFloat("{$shouxu}");
        $(".save-btn").on('click', function () {
            if (check()) {
                if(sx==0){
                    submit_deposit();
                    return;
                }
                layer.open({
                    content: '{$Think.lang.lxb_qdquchu}&nbsp;&nbsp;{$shouxu*100}%&nbsp;&nbsp;{$Think.lang.lxb_qdsxf}'
                    , btn: ['{$Think.lang.queding}', '{$Think.lang.quxiao}']
                    , yes: function (index) {
                        submit_deposit();
                        layer.close(index);
                    }
                });
            }
        });

        function submit_deposit() {
            var loading = null;
            $.ajax({
                url: '/index/ctrl/do_deposit',
                data: $("#main-form").serialize(),
                type: 'POST',
                beforeSend: function () {
                    loading = $(document).dialog({
                        type: 'notice',
                        infoIcon: '/static_new/img/loading.gif',
                        infoText: 'loading...',
                        autoClose: 0
                    });
                },
                success: function (data) {
                    loading.close();
                    if (data.code == 0) {
                        $(document).dialog({infoText: '{$Think.lang.with_q_ok}'});
                        setTimeout(function () {
                            window.location.href = '/index/my/index';
                        }, 2000);
                    } else {
                        if (data.code == -1) {
                            $(document).dialog({infoText: data.info, autoClose: 3000});
                            setTimeout(function () {
                                window.location.href = '/index/ctrl/recharge';
                            }, 3000);
                        } else {
                            $(document).dialog({infoText: data.info});
                            if (data.url) {
                                setTimeout(function () {
                                    window.location.href = data.url;
                                }, 3000);
                            }
                        }
                    }
                }
            });
        }
    })
</script>
</body>
</html>